<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">

    <link rel="shortcut icon" href="<!--{eval echo register_static('img/touch-icon-57x57.png');}-->">
    <title>粉粉管理系统</title>

    <!-- Bootstrap core CSS -->
    <link href="<!--{eval echo register_static('css/bootstrap.min.css');}-->" rel="stylesheet">
    <link href="<!--{eval echo register_static('css/bootstrap-reset.css');}-->" rel="stylesheet">
    <!--Animation css-->
    <link href="<!--{eval echo register_static('css/animate.css');}-->" rel="stylesheet">
    <!--Icon-fonts css-->
    <link href="<!--{eval echo register_static('assets/font-awesome/css/font-awesome.css');}-->" rel="stylesheet" />
    <link href="<!--{eval echo register_static('assets/ionicon/css/ionicons.min.css');}-->" rel="stylesheet" />
    <link href="<!--{eval echo register_static('assets/sweet-alert/sweet-alert.min.css');}-->" rel="stylesheet">
    <link href="<!--{eval echo register_static('assets/tagsinput/jquery.tagsinput.css');}-->" rel="stylesheet">
    <!-- Plugins css -->
    <link href="<!--{eval echo register_static('assets/modal-effect/css/component.css');}-->" rel="stylesheet">
    <!-- DataTables -->
    <link rel="stylesheet" href="<!--{eval echo register_static('assets/datatables/jquery.dataTables.min.css" rel="stylesheet');}-->" />
    <!-- Custom styles for this template -->
    <link href="<!--{eval echo register_static('css/style.css');}-->" rel="stylesheet">
    <link href="<!--{eval echo register_static('css/helper.css');}-->" rel="stylesheet">
    <!-- My styles for this template -->
    <link href="<!--{eval echo register_static('css/common.css');}-->" rel="stylesheet"></head>

<body>
    <!-- Aside Start-->
    <!--{template admin_v2/leftside}-->
    <!-- Aside Ends-->

    <!--Main Content Start -->
    <section class="content">
        
        <!-- Header -->
        <!--{template admin_v2/header}-->
        <!-- Header Ends -->

        <!-- Page Content Start -->
        <!-- ================== -->
        <div class="wraper container-fluid user-list">

            <div class="row">
                <div class="col-md-12">
                    <div class="panel panel-default">
                        <div class="panel-heading">
                            <h3 class="panel-title">系统账户预存金额(金额将以粉钻的形式存储)</h3>
                        </div>
                        <div class="panel-body">
                            <form class="form-horizontal" id="sendForm">
                                <div class="form-group">
                                    <label for="inputUid" class="col-sm-2 control-label">预存金额:</label>
                                    <div class="col-sm-10">
                                        <input type="text" name="amount" class="form-control"  id="amount" placeholder="请输入人民币金额">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <div class="col-sm-offset-2 col-sm-10">
                                        <button type="button" class="btn btn-primary build">确定</button>
                                    </div>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!-- Footer Start -->
        <!--{template admin_v2/footer}-->
        <!-- Footer Ends -->
     </section>
    <!-- Main Content Ends -->

    <!-- js placed at the end of the document so the pages load faster -->
    <script src="<!--{eval echo register_static('js/jquery.js');}-->"></script>
    <script src="<!--{eval echo register_static('js/bootstrap.min.js');}-->"></script>
    <script src="<!--{eval echo register_static('js/pace.min.js');}-->"></script>
    <script src="<!--{eval echo register_static('js/wow.min.js');}-->"></script>
    <script src="<!--{eval echo register_static('js/jquery.nicescroll.js');}-->" type="text/javascript"></script>

    <script src="<!--{eval echo register_static('js/jquery.app.js');}-->"></script>

    <script src="<!--{eval echo register_static('assets/datatables/jquery.dataTables.min.js');}-->"></script>
    <script src="<!--{eval echo register_static('assets/datatables/dataTables.bootstrap.js');}-->"></script>
    <script src="<!--{eval echo register_static('assets/sweet-alert/sweet-alert.min.js');}-->"></script>
    <script src="<!--{eval echo register_static('assets/sweet-alert/sweet-alert.init.js');}-->"></script>
    <script src="<!--{eval echo register_static('assets/tagsinput/jquery.tagsinput.min.js');}-->"></script>

    <!-- Modal-Effect -->
    <script src="<!--{eval echo register_static('assets/modal-effect/js/classie.js');}-->"></script>
    <script src="<!--{eval echo register_static('assets/modal-effect/js/modalEffects.js');}-->"></script>

    <!--layui-->
    <script src="<!--{eval echo register_static('layer/layer.js');}-->"></script>
    <script src="<!--{eval echo register_static('laytpl/laytpl.js');}-->"></script>


    <script type="application/javascript">
        $(document).ready(function() {
            $(document).off('click', '.build').on('click', '.build', function () {
                var amount = $("#amount").val();
                amount = $.trim(amount);
                if(amount == ''){
                    layer.msg('金额不能为空', {icon: 0});
                    return;
                }
                if(isNaN(amount)){
                    layer.msg('金额必须为整数', {icon: 0});
                    return;
                }
                layer.confirm('确定预存这么多金额么？？', {icon: 3, title:'提示'}, function(i){
                    var index = layer.load();
                    $.post(
                            '/admin.php?ac=deposited&op=build&amount=' + amount ,
                            function (r) {
                                layer.closeAll();
                                if(r._code == 1){
                                    layer.msg('预存成功！', {icon: 1});
                                }else{
                                    layer.msg(r._msg, {icon: 0});
                                }
                            }
                    );
                });
            });
       })

</script>
</body>
</html>